package com.zong.ai.agent.demo;

import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author: zongzi
 * @description: spring ai alibaba 调用灵积大模型 测试类
 * @date: 2025/6/10
 */
@Component
public class SpringAiAlibabaTest implements CommandLineRunner {
    @Resource
    private ChatModel dashScopeChatModel;

    @Override
    public void run(String... args) throws Exception {
        String text = dashScopeChatModel.call(new Prompt("你是谁?")).getResult().getOutput().getText();
        System.out.println(text);
    }
}
